<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <form id="my-form" class="am-form tpl-form-line-form" method="post">
                    <div class="widget-body">
                        <fieldset>
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl"><{$tit}>管理</div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">所属城市</label>
                                <div class="am-u-sm-9 am-u-end">
                                    <select name="data[city_id]"
                                            data-am-selected="{searchBox: 1, btnSize: 'sm'}">
                                        <option value="0">所属城市</option>
                                        <?php if (isset($data_list)): foreach ($data_list as $val): ?>
                                            <option value="<?= $val['id'] ?>"
                                                <?= $info['city_id'] == $val['id'] ? 'selected' : '' ?>
                                                <?= $info['id'] == $val ? 'disabled' : '' ?>>
                                                <?= $val['name'] ?></option>
                                        <?php endforeach; endif; ?>
                                    </select>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">名称 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="data[title]"
                                           value="<?= $info['title'] ?>" placeholder="请输入名称" required>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">标识 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="data[name]"
                                           value="<?= $info['name'] ?>" placeholder="请输入位置标识" required>
                                </div>
                            </div>
                            
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 图片 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <div class="am-form-file">
                                        <button type="button"
                                                class="upload-file am-btn am-btn-secondary am-radius">
                                            <i class="am-icon-cloud-upload"></i> 选择图片
                                        </button>
                                        <div class="uploader-list am-cf">
                                            <?php if ($info['img']): ?>
                                                <div class="file-item">
                                                    <img src="<?= $info['img']['file_path'] ?>">
                                                    <input type="hidden" name="data[img]"
                                                        value="<?= $info['img']['file_id'] ?>">
                                                    <i class="iconfont icon-shanchu file-item-delete"></i>
                                                </div>
                                            <?php endif; ?>
                                        </div>
                                    </div>
                                    <div class="help-block am-margin-top-sm">
                                        <small>尺寸750x750像素以上，大小2M以下 (可拖拽图片调整显示顺序 )</small>
                                    </div>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">排序 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="number" min="0" class="tpl-form-input" name="data[sort]" value="<{$info.sort}>"
                                        required>
                                    <small>数字越小越靠前</small>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">状态 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <{html_radios1("data[status]",$statusRadio,$info.status)}>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
                                    <button type="submit" class="j-submit am-btn am-btn-secondary">提交
                                    </button>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>


<!-- 图片文件列表模板 -->
<{include file="admin/public/_template/tpl_file_item.php"}>
<!-- 文件库弹窗 -->
<{include file="admin/public/_template/file_library.php"}>
<script src="/static/assets/common/js/vue.min.js"></script>
<script src="/static/assets/common/js/ddsort.js"></script>
<script src="/static/assets/common/plugins/umeditor/umeditor.config.js?v=<?= $version ?>"></script>
<script src="/static/assets/common/plugins/umeditor/umeditor.min.js"></script>
<script src="/static/assets/store/js/select.data.js?v=<?= $version ?>"></script>
<script src="/static/assets/store/js/app.js?v=1.0"></script>
<script src="/static/assets/store/js/file.library.js?v=1.0"></script>
<script>
    $(function () {

        // 选择图片
        $('.upload-file').selectImages({
            name: 'data[img]'
            , multiple: false
        });

        // 图片列表拖动
        $('.uploader-list').DDSort({
            target: '.file-item',
            delay: 100, // 延时处理，默认为 50 ms，防止手抖点击 A 链接无效
            floatStyle: {
                'border': '1px solid #ccc',
                'background-color': '#fff'
            }
        });

        /**
         * 表单验证提交
         * @type {*}
         */
        $('#my-form').superForm();


    });
</script>
